package com.huayue.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import com.huayue.annotation.LogAnno;
import com.huayue.entity.Supplier;
import com.huayue.service.SupplierService;
import com.huayue.util.PageHelper;

/**
 * 供应商
 * 
 */
@Controller
@RequestMapping("/supplier")
public class SupplierController {
    @Autowired
    SupplierService svc;

    BaseController bc = new BaseController();

    @LogAnno(operateType = "添加-供应商")
    @RequestMapping("/add")
    public ModelAndView add(Supplier supplier) {
        return bc.add(svc, supplier);
    }

    @LogAnno(operateType = "修改-供应商")
    @RequestMapping("/update")
    public ModelAndView update(Supplier supplier) {
        return bc.update(svc, supplier);
    }

    @LogAnno(operateType = "删除-供应商")
    @RequestMapping("/delete")
    public ModelAndView delete(Supplier supplier) {
        return bc.delete(svc, supplier);
    }

    @RequestMapping(value = "/findOne", produces = {"text/javascript;charset=UTF-8"})
    public ModelAndView findOne(Supplier supplier) {
        return bc.findOne(svc, supplier);
    }

    @RequestMapping("/findPage")
    public ModelAndView findPage(PageHelper page, Supplier supplier) {
        return bc.findPage(svc, page, supplier, supplier);
    }

}
